package day01;

import java.util.Scanner;

/**
 * 要求用户从控制台输入一个email地址，然后获取该email的用户名(@之前的内容)
 * @author Bonnie
 *
 */
public class Test04 {
	public static void main(String[] args) {
		//获取输入
		Scanner scanner = new Scanner(System.in);
		System.out.print("请输入邮箱地址:");
		String email = scanner.next();
		scanner.close();
		//截取字符串
		String answer = email.substring(0, email.lastIndexOf("@"));
		System.out.println(answer);

	}
}
